
/**
 * @author idea
 * @data 2019/2/17
 */
public class Demo {


    public void syncBlock() {
        synchronized (this) {
            System.out.println("hello block");
        }
    }

    public synchronized void syncMethod() {
        System.out.println("hello method");
    }


}
